package com.neusoft.demo.server;

import com.neusoft.demo.mapper.FoodsMapper;
import com.neusoft.demo.pojo.Bumen;
import com.neusoft.demo.pojo.Foods;
import com.neusoft.demo.pojo.Yuangong;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FoodsServer {
    @Autowired(required = false)
    FoodsMapper foodsMapper;

    public java.util.List<Foods> foodsList(int bid){
        return foodsMapper.findFoods(bid);
    }
    //添加
    public boolean addFoods(Foods foods){
       int n=foodsMapper.addFoods(foods);
        if(n>0){
            return  true;
        }else{
            return  false;
        }
    }
    public boolean updateFoods(Foods foods){
        int n=foodsMapper.updateFood(foods);
        if(n>0){
            return true;
        }else {
            return  false;
        }
    }
    public boolean upTot(int tot,int foodId){
        int n=foodsMapper.updateTot(tot, foodId);
        if(n>0){
            return true;
        }else {
            return  false;
        }
    }
    public boolean upT(int tot){
        int n=foodsMapper.upT(tot);
        if(n>0){
            return true;
        }else {
            return  false;
        }
    }
    public  boolean delFoods(int foodId){
        int n=foodsMapper.delFoods(foodId);
        if(n>0)
            return  true;
        else
            return false;
    }
    public java.util.List<Foods> search(String foodName,int beginSal,int endSal,int businessId){
        return foodsMapper.Search(foodName, beginSal, endSal,businessId);
    }
    public java.util.List<Foods> findYuangongById(){

        return  foodsMapper.findFoodsById();
    }
}
